1. Field of the Invention
The present invention relates to a method of recording an object allocation site, and particularly to a method of recording an object allocation site with a low cost and to a program therefore.
2. Description of Related Art
In general the building of a large scale application by use of an object-oriented language such as JAVA®. One of problems involved in a system running such an application is that the system goes down once the heap is used up because a large number of created objects are not collected by garbage collection (GC). Important functions to address this problem are to obtain a memory dump at the time of system failure and to then determine in which code in an application each of the objects remaining in the heap are created, i.e., to determine an “object allocation site.”
To achieve these functions, there is an approach of logging an object allocation site by use of Java virtual machine tool interface (JVMTI) or the like, every time an object is created. This approach, however, has problems of slowing down execution and of enormously increasing the size of a recording region. Besides, when using this approach it is difficult to collect characteristics of the object allocation sites at runtime and thus to use the collected characteristics for optimization. Meanwhile, another approach to achieve the aforementioned functions is to additionally provide an object itself with a region to record an object allocation site. This approach needs only a small overhead at runtime, but requires additional memory for the allocation site recording. For this reason, this approach is not adequate to solve a shortage in memory. Moreover, when using this approach it is difficult to collect information on the object allocation sites for optimization.
Conventional methods are disclosed in U.S. Application Publication 2010/0229159 A1, in Chiba, “High-performance Write Barriers for Thread-local Garbage Collection,” in Information Processing Society of Japan (IPSJ) Transactions on Programming, Vol. 45, No. SIG5 (2004): pp. 53-61, and the like. These are a method of converting (or coding) information on an object allocation site and then embedding the converted (or coded) information in a region called “hashcode” which inherently exists in an object header of some Java environments. This method, however, is not applicable to an object model which has no such region. Moreover, this method is disadvantageous in that it involves an overhead such as a cost for converting the allocation site. Furthermore, since it is converted, the information on the allocation site is difficult to use at application runtime.